//logs.js
const util = require('../../utils/util.js')

Page({
  data: {
    logs: [],
    hotSales: [
      {
        product_id: '001',
        title: 'LV Neverfull',
        price: 5000,
        imgUrl: '/image/baobao.png'
      },
      {
        product_id: '002',
        title: 'LV Neverfull',
        price: 5000,
        imgUrl: '/image/baobao.png'
      },
      {
        product_id: '003',
        title: 'LV Neverfull',
        price: 5000,
        imgUrl: '/image/baobao.png'
      },
      {
        product_id: '004',
        title: 'LV Neverfull',
        price: 5000,
        imgUrl: '/image/baobao.png'
      }
    ]
  },
  onLoad: function () {
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })
  }
})
